Warning track interruption facility

ABSTRACT

A program (e.g., an operating system) is provided a warning that it has a grace period in which to perform a function, cleanup (e.g., complete, stop and/or move a dispatchable unit). The program is being warned, in one example, that it is losing access to its shared resources. For instance, in a virtual environment, a guest program is warned that it is about to lose its central processing unit resources, and therefore, it is to perform a function, such as cleanup.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. Ser. No. 14/322,157 entitled“WARNING TRACK INTERRUPTION FACILITY,” filed Jul. 2, 2014, now U.S. Pat.No. 9,098,478, which is a continuation of U.S. Ser. No. 13/352,509entitled “WARNING TRACK INTERRUPTION FACILITY,” filed Jan. 18, 2012(U.S. Pat. No. 8,850,450 issued Sep. 30, 2014), each of which is herebyincorporated herein by reference in its entirety.

BACKGROUND

An aspect of this invention relates, in general, to processing within acomputing environment, and in particular, to facilitating processingassociated with shared resources.

One type of environment in which resources are shared is a virtualenvironment, which includes a host central processing unit (CPU) and oneor more guest central processing units. A guest CPU (also known as avirtual CPU) is provisioned by a host program (e.g., host operatingsystem) executing on a host CPU. The host program performs actions toallocate resources from an underlying host configuration and to assignthose resources to the guest CPU.

In one particular embodiment, a guest CPU exists when a host CPU entersthe interpretive-execution mode. At this point, the guest operatingsystem (also referred to herein as the guest program) begins executionon the virtualized CPU, while the host program suspends execution on thehost CPU. The host program resumes execution on the CPU when theinterpretive-execution mode ends. Linkage techniques exist between thehost and the guest by which host and guest state is saved and restored.Typically, when a host program starts a guest program, the host programsuspends until the guest program returns. Both the guest CPU and hostCPU are different modes of the one host CPU.

The host configuration usually includes all of the resources of thecomputer system. These resources include, but are not limited to,central processing units (CPUs), main memory, and input/output (I/O)devices. In such a system, multiple guest CPUs may be supported from asingle host CPU. This is accomplished by assigning each guest CPU aperiod of time to use the host CPU, called a timeslice, and then movingthe host CPU to another guest CPU for a timeslice, and so forth. Thenumber of guest CPUs supportable by a host CPU varies according to thecapabilities of the host CPU and the desired capability to be assignedto each guest CPU.

A guest configuration is typically formed from two or more guest CPUs,and is referred to as a guest multiprocessing (MP) configuration. Eachguest CPU can be provisioned by a share of a separate host CPU or evenby sharing a single host CPU. One attribute of such sharing is that aguest CPU can operate for a period of time, referred to as a timeslice,and then is inactive for some arbitrary period of time. The inactiveperiod varies based on priority policies established by the system, theoverall number of guest CPUs that are to share host CPUs, and theparticular sharing technique being used.

In such a guest multiprocessing system, a program, sometimes called adispatchable unit (DU), can be dispatched by the guest operating systemon a guest CPU, and then during execution of that dispatchable unit, thehost timeslice of that dispatchable unit expires. This could leave thedispatchable unit in such a condition that it cannot be continued on anyother guest CPU of the guest multiprocessing configuration, regardlessof the availability of any other guest CPUs. Instead, it must wait forthe one and only guest CPU to receive its next timeslice in order tocontinue. Based on the sharing technique and the relative priority ofthe guest configuration, the next timeslice can be delayed for asubstantial period of time. Even if the guest configuration has otherguest CPUs that are capable of running the dispatchable unit,continuation of the dispatchable unit is not possible due to the stateof the dispatchable unit's guest CPU that was saved when the priortimeslice expired. Until that precise state can be used to continue theguest CPU, the dispatchable unit is inactive.

BRIEF SUMMARY

Shortcomings of the prior art are overcome and advantages are providedthrough the provision of a computer program product for facilitatingprocessing in a computing environment. The computer program productincludes, for instance, a computer readable storage medium readable by aprocessing circuit and storing instructions for execution by theprocessing circuit for performing a method. The method includes, forinstance, providing by a first program to a second program a warningtrack facility installed indication indicating installation of a warningtrack facility within the computing environment, the indication ofinstallation to be obtained by the second program, and the warning trackfacility to provide to the second program a grace period to perform afirst function; obtaining, by the first program based on the providing,an unsolicited indication that the second program has registered for thewarning track facility, the registration comprising an indication to thefirst program that the second program understands a protocol of thewarning track facility and intends to participate in the warning trackfacility; enabling, based on obtaining the indication that the secondprogram has registered, the warning track facility for the secondprogram; providing by the first program to the second program a warningtrack notification to notify the second program of the grace period inwhich to initiate the first function; performing by the first program asecond function subsequent to the grace period; determining whether thesecond program voluntarily exited prior to expiration of the graceperiod; based on determining the second program voluntarily exited priorto expiration of the grace period, providing to the second program, anext time the second program executes, positive feedback indicatingvoluntarily exiting prior to expiration of the grace period; and basedon determining the second program is tardy on voluntarily exiting priorto expiration of the grace period, providing to the second program, anext time the second program executes, an exception feedback indicationindicating tardiness in voluntarily exiting.

Further, a computer system for facilitating processing in a computingenvironment is provided. The computer system includes, for instance, amemory; and a processor in communications with the memory, wherein thecomputer system is configured to perform a method. The method includes,for instance, providing by a first program to a second program a warningtrack facility installed indication indicating installation of a warningtrack facility within the computing environment, the indication ofinstallation to be received by the second program, and the warning trackfacility to provide to the second program a grace period to perform afirst function; obtaining, by the first program based on the providing,an unsolicited indication that the second program has registered for thewarning track facility, the registration comprising an indication to thefirst program that the second program understands a protocol of thewarning track facility and intends to participate in the warning trackfacility; enabling, based on obtaining the indication that the secondprogram has registered, the warning track facility for the secondprogram; providing by the first program to the second program a warningtrack notification to notify the second program of the grace period inwhich to initiate the first function; performing by the first program asecond function subsequent to the grace period, wherein the grace periodis distinguishable from a timeslice provided to a processor on which thesecond program executes, the second program having access to sharedresources of the computing environment during the timeslice, and whereinthe grace period provides a period in addition to the timeslice, whereinany portion of the period used by the second program to perform thefirst function is charged against a next timeslice for the secondprogram; determining whether the second program voluntarily exited priorto expiration of the grace period; based on determining the secondprogram voluntarily exited prior to expiration of the grace period,providing to the second program, a next time the second programexecutes, positive feedback indicating voluntarily exiting prior toexpiration of the grace period; and based on determining the secondprogram is tardy on voluntarily exiting prior to expiration of the graceperiod, providing to the second program, a next time the second programexecutes, an exception feedback indication indicating tardiness involuntarily exiting.

Computer program products, systems and methods relating to one or moreaspects of the present invention are also described and may be claimedherein. Further, services relating to one or more aspects of the presentinvention are also described and may be claimed herein.

Additional features and advantages are realized through the techniquesof the present invention. Other embodiments and aspects of the inventionare described in detail herein and are considered a part of the claimedinvention.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

One or more aspects of the present invention are particularly pointedout and distinctly claimed as examples in the claims at the conclusionof the specification. The foregoing and objects, features, andadvantages of the invention are apparent from the following detaileddescription taken in conjunction with the accompanying drawings inwhich:

FIG. 1 depicts one embodiment of a computing environment to incorporateand use one or more aspects of the present invention;

FIG. 2 depicts another embodiment of a computing environment toincorporate and use one or more aspects of the present invention;

FIG. 3 depicts yet another embodiment of a computing environment toincorporate and use one or more aspects of the present invention;

FIG. 4 depicts one embodiment of the logic associated with guestobservation of the warning track interruption facility, in accordancewith an aspect of the present invention;

FIG. 5 depicts one embodiment of the logic associated with hostobservation of the warning track interruption facility, in accordancewith an aspect of the present invention;

FIG. 6 depicts one embodiment of the logic associated with a hosthandling a guest exit, in accordance with an aspect of the presentinvention;

FIG. 7 depicts one embodiment of an overview of the warning trackinterruption facility logic, in accordance with an aspect of the presentinvention;

FIGS. 8A-8C depict embodiments of the logic associated with the warningtrack interruption facility processing, in accordance with an aspect ofthe present invention;

FIG. 9 depicts one embodiment of the logic associated with receiving awarning track interruption, in accordance with an aspect of the presentinvention;

FIG. 10 depicts one embodiment of a format of a Diagnose instructionused in accordance with an aspect of the present invention;

FIG. 11 depicts one embodiment of a computer program productincorporating one or more aspects of the present invention;

FIG. 12 depicts one embodiment of a host computer system to incorporateand use one or more aspects of the present invention;

FIG. 13 depicts a further example of a computer system to incorporateand use one or more aspects of the present invention;

FIG. 14 depicts another example of a computer system comprising acomputer network to incorporate and use one or more aspects of thepresent invention;

FIG. 15 depicts one embodiment of various elements of a computer systemto incorporate and use one or more aspects of the present invention;

FIG. 16A depicts one embodiment of the execution unit of the computersystem of FIG. 15 to incorporate and use one or more aspects of thepresent invention;

FIG. 16B depicts one embodiment of the branch unit of the computersystem of FIG. 15 to incorporate and use one or more aspects of thepresent invention;

FIG. 16C depicts one embodiment of the load/store unit of the computersystem of FIG. 15 to incorporate and use one or more aspects of thepresent invention; and

FIG. 17 depicts one embodiment of an emulated host computer system toincorporate and use one or more aspects of the present invention.

DETAILED DESCRIPTION

In accordance with an aspect of the present invention, a capability isprovided for warning a program (e.g., an operating system) that it has agrace period in which to perform a function. For instance, a program isgiven a grace period to perform cleanup (e.g., complete, stop and/ormove a dispatchable unit).

In accordance with a further aspect of the present invention, a programand/or a processor is warned that it is about to lose access toresources (e.g., shared resources). For instance, a warning is providedto a processor sharing resources with other processors that theprocessor is about to lose access to the resources. As a furtherexample, a program, such as an operating system, executing on a sharedprocessor (i.e., the program shares the processor with other programs)is warned that it is about to lose its processor resources.

In one particular embodiment, a capability is provided in which a guestprogram executing on a guest CPU provisioned by a host CPU is provided awarning of expiration of a timeslice given to the guest CPU from thehost CPU or of pre-emption by the host of the guest's timeslice. Thewarning provides a grace period that the guest CPU can use to perform aparticular function, such as complete execution of a dispatchable unit,stop the dispatchable unit at a point in which the dispatchable unit isre-dispatchable, and/or move the dispatchable unit to another guest CPU.

As used herein, a grace period includes as examples an amount of time, anumber of instructions, a number of cycles, etc. It is of apredetermined duration in which one or more functions can be performed.

One embodiment of a computing environment to incorporate and use one ormore aspects of the present invention is described with reference toFIG. 1. In this particular embodiment, a computing environment 100includes a plurality of processors 102 sharing resources 104. Eachprocessor (and/or a program, such as an operating system, executing onthe processor) is given a certain amount of time, referred to as atimeslice, to share the resources. The resources include centralprocessing unit resources, memory, input/output devices or interfaces,and/or other resources, as examples. The processor (or a programexecuting thereon) having access to the resources is warned that itsaccess is about to end, and therefore, the processor (or program) is toperform a particular action, such as clean-up, completing a unit ofwork, stopping a unit of work, moving a unit of work, etc.

Another embodiment of a computing environment 200 to incorporate and useone or more aspects of the present invention is described with referenceto FIG. 2. Computing environment 200 is based, for instance, on thez/Architecture® offered by International Business Machines Corporation(IBM®), Armonk, N.Y. The z/Architecture® is described in an IBM®publication entitled, “z/Architecture Principles of Operation,” IBM®Publication No. SA22-7832-08, Ninth Edition, August, 2010, which ishereby incorporated herein by reference in its entirety. In one example,a computing environment based on the z/Architecture® includes a SystemZ® server, offered by International Business Machines Corporation,Armonk, N.Y. IBM®, z/Architecture® and zSeries®, as well as z/VM® andz/OS® mentioned below, are registered trademarks of InternationalBusiness Machines Corporation, Armonk, N.Y., USA. Other names usedherein may be registered trademarks, trademarks, or product names ofInternational Business Machines Corporation or other companies.

As one example, computing environment 200 includes a central processorcomplex (CPC) 202 providing virtual machine support. CPC 202 includes,for instance, one or more virtual machines 204 (or in anotherembodiment, logical partitions), one or more central processors 206, atleast one host 208 (e.g., a control program, such as a hypervisor), andan input/output subsystem 210, each of which is described below. In thisexample, the virtual machines and host are included in memory.

The virtual machine support of the CPC provides the ability to operatelarge numbers of virtual machines, each capable of hosting a guestoperating system 212, such as z/VM®, z/OS® or Linux, as examples. Eachvirtual machine 204 is capable of functioning as a separate system. Thatis, each virtual machine can be independently reset, host a guestoperating system, and operate with different programs. An operatingsystem or application program running in a virtual machine appears tohave access to a full and complete system, but in reality, only aportion of it is available.

The physical resources of the CPC (e.g., CPUs, memory, I/O devices,etc.) are owned by host 208, and the shared physical resources aredispatched by the host to the guest operating systems, as needed, tomeet their processing demands. The interactions between the guestoperating systems and the physical shared machine resources arecontrolled by the host, since the large number of guests typicallyprecludes the host from simply partitioning and assigning the hardwareresources to the configured guests.

Central processors 206 are physical processor resources that areassignable to a virtual machine. For instance, virtual machine 204includes one or more logical processors, each of which represents all ora share of a physical processor resource 206 that may be dynamicallyallocated to the virtual machine. Virtual machines 204 are managed byhost 208. As examples, the host may be implemented in microcode runningon processors 206 or may be a part of a host operating system executingon the machine. In one example, host 208 is the ProcessorResource/System Manager (PR/SM) offered by International BusinessMachines Corporation, Armonk, N.Y.

Input/output subsystem 210 directs the flow of information betweendevices and main storage. It is coupled to the central processingcomplex, in that it can be part of the central processing complex orseparate therefrom. The I/O subsystem relieves the central processors ofthe task of communicating directly with the I/O devices coupled to theCPC and permits data processing to proceed concurrently with I/Oprocessing.

In one embodiment, the host (e.g., PR/SM) and processor (e.g., SystemZ®) hardware/firmware interact with each other in a controlledcooperative manner in order to process guest operating system operationswithout requiring transfer of control from/to the guest operating systemand the host. Guest operations can be executed directly without hostintervention via a facility that allows instructions to beinterpretively executed for a guest. This facility provides aninstruction, Start Interpretive Execution (SIE), which the host canissue, designating a control block called a state description whichholds guest (virtual machine) state and controls. The instruction placesthe CPU into an interpretive execution mode in which guest instructionsand interruptions are processed directly, until a condition requiringhost attention arises. When such a condition occurs, interpretiveexecution is ended, and either a host interruption is presented, or theSIE instruction completes storing details of the condition encountered;this latter action is called interception. One example of interpretiveexecution is described in “System/370 Extended Architecture/InterpretiveExecution,” IBM Publication No. SA22-7095-01, September 1985, which ishereby incorporated herein by reference in its entirety.

As used herein, firmware includes, e.g., the microcode, millicode and/ormacrocode of the processor. It includes, for instance, thehardware-level instructions and/or data structures used inimplementation of higher level machine code. In one embodiment, itincludes, for instance, proprietary code that is typically delivered asmicrocode that includes trusted software or microcode specific to theunderlying hardware and controls operating system access to the systemhardware.

Another example of a computing environment to incorporate one or moreaspects of the present invention is depicted in FIG. 3. In this example,an emulated host computer system 300 is provided that emulates a hostcomputer 302 of a host architecture. In emulated host computer system300, a host processor (CPU) 304 is an emulated host processor (orvirtual host processor) and is realized through an emulation processor306 having a different native instruction set architecture than used bythe processors of host computer 302. Emulated host computer system 300has memory 308 accessible to emulation processor 306. In the exampleembodiment, memory 308 is partitioned into a host computer memoryportion 310 and an emulation routines portion 312. Host computer memory310 is available to programs of emulated host computer 302 according tohost computer architecture, and may include both a host or hypervisor314 and one or more virtual machines 316 running guest operating systems318, analogous to the like-named elements in FIG. 2.

Emulation processor 306 executes native instructions of an architectedinstruction set of an architecture other than that of the emulatedprocessor 304. The native instructions are obtained, for example, fromemulation routines memory 312. Emulation processor 306 may access a hostinstruction for execution from a program in host computer memory 310 byemploying one or more instruction(s) obtained in a sequence &access/decode routine which may decode the host instruction(s) accessedto determine a native instruction execution routine for emulating thefunction of the host instruction accessed. One such host instruction maybe, for example, a Start Interpretive Execution (SIE) instruction, bywhich the host seeks to execute a guest program in a virtual machine.The emulation routines 312 may include support for this instruction, andfor executing a sequence of guest instructions in a virtual machine 316in accordance with the definition of this SIE instruction.

Other facilities that are defined for the architecture of host computersystem 302 may be emulated by architected facilities routines, includingsuch facilities as general purpose registers, control registers, dynamicaddress translation, and I/O subsystem support and processor cache, asexamples. The emulation routines may also take advantage of functionsavailable in emulation processor 306 (such as general registers anddynamic translation of virtual addresses) to improve performance of theemulation routines. Special hardware and offload engines may also beprovided to assist processor 306 in emulating the functions of hostcomputer 302.

In accordance with an aspect of the present invention, a warning trackinterruption facility is provided that may be used in many types ofcomputing environments. Although it may be used in many types ofenvironments, aspects of the facility are described herein withreference to a guest multiprocessing system. As described above, inguest multiprocessing systems, guest operating systems dispatchdispatchable units (e.g., programs, code, etc.) on guest centralprocessing units that are hosted by at least one host central processingunit. The host CPU provides a timeslice (e.g., an amount of time orother period, such as number of instructions, number of cycles, etc.) tothe guest CPU during which time the dispatchable unit executes. Ifduring execution of the dispatchable unit, the timeslice expires, thedispatchable unit can be left in such a condition that it cannot becontinued on any other guest CPU of the guest multiprocessingconfiguration, regardless of the availability of any other guest CPUs.Instead, it must wait for the one and only guest CPU to receive its nexttimeslice in order to continue. Based on the particular sharingtechnique employed and the relative priority of the guest configuration,the next timeslice can be delayed for a substantial period of time. Evenif the guest configuration has other guest CPUs that are capable ofrunning the dispatchable unit, continuation of the dispatchable unit isnot possible due to the state of the dispatchable unit's guest CPU thatwas saved when the prior timeslice expired. Until that precise state canbe used to continue the guest CPU, the dispatchable unit is inactive.

It is possible to extend the timeslice by granting additional time (orother additional period, such as additional instructions, cycles, etc.),but even with this extra time, the guest CPU could extend execution ofthe dispatchable unit, and still leave it in the same undispatchablecondition as it would be in at expiration of the normal timeslice.

Since a host program does not know the controls and state used by anarbitrary guest program running an arbitrary dispatchable unit, alwaysgranting extra time for the guest operating system to clean up itsdispatchable unit cannot be done without establishing a protocol betweenthe host program and the guest program. Without a protocol, any extratime granted to the guest CPU would be consumed in the main processingand still possibly conclude with the same dispatchable unit stuckcondition. Therefore, in accordance with an aspect of the presentinvention, such a protocol is provided.

In accordance with an aspect of the present invention, a grace period orextension is provided that includes a warning indicating to the guestprogram that particular action should be taken (e.g., complete adispatchable unit or make the dispatchable unit re-dispatchable). Asexamples, the grace period is provided in response to expiration of thetimeslice, or in response to the host pre-empting the guest, prior toexpiration of its timeslice, in order to reclaim the processor for someother higher priority, as seen by the host, as described in furtherdetail herein.

As one example, the grace period is provided instead of unconditionallyextending the timeslice. If the normal timeslice has completely expired,a grace period is provided, but charged against the next normaltimeslice in order to remain fair to all other virtualized guests thateach have a timeslice expectation. If the normal timeslice has notexpired, the grace period is taken from the normal time remaining Eitherway, the grace period limits the remaining time (or other period) givento the guest CPU and is not itself extendable. Thus, the guest CPUcannot continue to run for an arbitrary and unknown period.

At the beginning of the grace period, the guest program is notified forthe purpose of cleaning up the dispatchable unit (e.g., completing it,stopping it, and/or moving it). Enforcement of the grace period ensuresthat the guest CPU does not exceed the additional period granted. Theprotocol by which the guest program is given a grace period and isnotified that time (or other period) is almost expired (the grace periodhas begun) is an agreement between the guest program and the hostprogram that the protocol is understood by the guest program, therebymaking such a notification worthwhile. That is, the guest program wouldnormally honor the notification by, when necessary, making the currentdispatchable unit dispatchable on another guest CPU of the guestconfiguration (e.g., moving it).

Further details regarding the protocol and the warning trackinterruption facility (also referred to as warning track or warningtrack facility) are described below with reference to FIGS. 4-10. Theembodiment described with reference to those figures relates to avirtual environment having one or more guests provisioned by one or morehosts. However, one or more aspects of the present invention relate toother environments as well, including non-virtual environments in whichmultiple processors and/or multiple programs share resources.

With reference to FIG. 4, details regarding the warning trackinterruption facility protocol as observed by a guest are described. Thewarning track protocol, as observed by the guest, includes, forinstance, a facility installed indication, guest registration,notification and voluntary exit, each of which is described below.

Referring to FIG. 4, the guest program understands the warning trackprotocol and searches for a facility installed indication, STEP 400. Inone example, this indication is a bit stored in a control block (e.g., aService Call Control Block (SCCB)), which is observed using a readcommand, such as a Read SCP Information command. Subsequent todetermining the facility is installed, the guest program performsregistration, STEP 402. Registration is a mechanism in which the guestprogram communicates to the host program that the guest programunderstands the warning track interruption facility protocol. In oneexample, registration is performed using a Diagnose instruction, anexample of which is described further below.

Registration initiated from any guest central processing unit covers, inone embodiment, all guest central processing units of themultiprocessing configuration, since consistent behavior across guestCPUs of the guest multiprocessing configuration is desired. In a guestmultiprocessing configuration, guest CPUs use the same main memory andit is assumed that the guest CPUs operate in what is sometimes called asingle image. Thus, registration of one guest CPU is applicable to theother guest CPUs of the multiprocessing environment. Registration isirrevocable, in one embodiment, and this helps to avoid timing windows,simplifies development and allows for improved testability. Even thoughregistration is irrevocable, the guest program can determine whether itwill continue to participate in the protocol. If it so chooses, it neednot participate by resetting or having reset one or more enablementindicators described below.

Subsequent to registering the guest program for the warning trackprotocol, a guest CPU may be notified of a grace period, STEP 404. Forinstance, it may be warned by a host CPU of expiration of a timeslice(or an impending expiration, in a further example) or of pre-emption ofits timeslice. In one particular example, a CPU of a registered guestconfiguration is notified, for instance, of expiration of its normaltimeslice and the beginning of a grace period that provides anadditional period to, for instance, clean-up.

Subsequent to being notified, the guest has a constrained amount of timeor other period, the grace period (e.g., 50 microseconds in oneparticular embodiment), to make a dispatchable unit re-dispatchable orto make any other appropriate adjustments. If the normal timeslice hasalready ended, then before, for instance, returning control to the host,the grace period is used to make the dispatchable unit re-dispatchableor to make any other appropriate adjustments. If the timeslice has notended, then the grace period is used and any remaining portion of thetimeslice is relinquished. Normal accounting of the actual time used bya guest CPU occurs.

Subsequent to making the notification, the guest CPU is in a constrainedperiod (e.g., limited amount of time) after which operation of the guestCPU is involuntarily ended. Only one notification is made for eachnormal timeslice period. Thus, the guest CPU is still constrained by afinal time control which ensures that the underlying shared host CPU canbe shared elsewhere, thereby preserving good order and discipline in theoverall virtualization provided by the host program.

Notification may be accomplished by any mechanism that causes a uniquestatus to be detected by the guest program. Examples include a uniqueguest interruption, an architecturally defined main memory location thatcan be set, or an I/O external memory device available to both host andguest. The first requires an appropriate guest enablement to allow theinterruption. The latter two require periodic examinations sufficientlyoften that the grace period is not wasted. In one particular example ofthe z/Architecture®, a guest interruption, referred to as a warningtrack interruption (WTI), is used as notification.

Subsequent to being warned, the guest voluntarily exits its giventimeslice/grace period, STEP 406. The guest ends the currenttimeslice/grace period after being notified and making the dispatchableunit re-dispatchable (e.g., stop and move the dispatchable unit, orcomplete it). This exit signals to the host program the guest is indeedfollowing the protocol. Other reasons for a guest to relinquish control,thus returning to the host program may occur. Normally, for theconstrained processing to make a dispatchable unit re-dispatchable,conditions would not occur for any such extraneous exits. If the guestCPU exits within the grace period via the warning track interruptionprotocol, a feedback indication is given on the next timeslice, wheneverthat occurs. Thus, the guest program knows that it met the timeconstraint imposed by the grace period.

If the guest is tardy on the voluntary exit, its execution is preemptedby expiration of the grace period. The next time the guest CPU isstarted with a normal timeslice, a feedback indication is given so thatthe guest knows it had been tardy. Generally, this can be used forproblem determination in the guest program because the usual graceperiod allows for sufficient time to clean up and voluntarily exit.

If an extraneous exit occurs, the next time the guest CPU is startedwithin a normal timeslice, it is expected that the voluntary exit wouldquickly occur. The same feedback mechanism would inform the guestprogram that an extraneous exit has intervened and thus providedifferent information to inform problem determination.

The voluntary exit is accomplished by any mechanism that causes controlto pass through the host program from the guest program, and whichincludes the aforementioned feedback mechanism. The mechanism used is tobe defined in the warning track interruption protocol of the particulararchitecture in order for the host program to recognize the guestrequest. In one example, this mechanism includes the Diagnoseinstruction described below.

In addition to the guest observation of the warning track interruptionprotocol, in one embodiment, the host also observes the facility, asdescribed in further detail below with reference to FIG. 5.

Referring to FIG. 5, the host recognizes the facility installedindication and reflects it to its guests, STEP 500. For instance, thehost checks the installed bit in the control block (e.g., SCCB) andrecognizes the installed status of the warning track protocol (i.e., itis set) and knows how the host program may use it to the advantage ofthe host. Thus, the facility indication is reflected to its guest. Forinstance, to reflect the facility to a guest, the host sets an installedbit in a guest control block (e.g., guest SCCB) or an area of memoryaccessible to the guest. If, for any reason, the host program does notwant a guest to observe the installed status of the warning trackinterruption facility protocol and not allow a guest to observe itsinstalled status and use it, the host program passes an uninstalledindication to the guest (e.g., sets the bit seen by the guest to zero).Furthermore, in one embodiment, the host program sets the controls ofthe guest CPUs such that the warning track protocol is disabled (e.g.,turns off one or more designated bits in the state description of theguest CPU).

As registration is initiated by a guest, the host program receives theunsolicited registration request and remembers that the guest hasregistered, STEP 502. A registration request initiated by any singleguest CPU is sufficient to register all guest CPUs in a guestmultiprocessing configuration. Thus, the host program enables thewarning track protocol for all CPUs of the guest configuration, STEP504. For instance, the host program sets one or more designated bits inthe state description of the guest CPU to enable the warning trackinterruption facility for the guests. Feedback of registration is notnecessarily returned to the guest. Were a guest CPU to attemptregistration even when the facility is not installed, the host wouldignore the request and would not enable guest CPUs for the warning trackinterruption facility protocol.

Subsequent to registering and enabling the guests for the warning trackfacility, a guest may receive notification of invocation of theprotocol, STEP 506. This may be accomplished in a number of scenarios,as described below.

As one example, when the warning track interruption protocol is enabledfor a guest CPU operating in the interpretive execution mode on a hostCPU, say host CPU X, the host program may initiate the protocol fromhost CPU Y. That is, a guest CPU has been provisioned with a host CPU Xand that host CPU X is presently not available to the host program. Ifthe host program has reason to reacquire CPU X, it first causes CPU X toexit the interpretive execution mode. That is, the guest CPU is stopped,thereby exiting the interpretive execution mode of CPU X. Stopping theguest CPU at any arbitrary point without allowing the guest CPU tovoluntarily stop itself creates a risk of a problem of which the warningtrack interruption protocol is meant to solve. The warning trackinterruption protocol allows host CPU Y to request notification byallowing a host program action to be transformed into a notification inguest CPU X, STEP 506. Since the guest program has previouslyregistered, the host program has an expectation that the guest programrecognizes the notification and supports appropriate handling of thenotification including the last step of voluntarily ending execution,thus returning control of host CPU X to the host program. Once thisoccurs, the host program can proceed with whatever use of host CPU Xmight have caused the process to be initiated.

The host program notifies a guest by, for instance, setting any status,setting an indicator (e.g., a bit), or causing an unsolicited,asynchronous signal (e.g., a warning track interruption) to be sent tothe guest. Although registered, the time of receipt of such anotification signal is still unknown in the guest. By registering, theguest has just agreed to adhere to the protocol if and when signaled.

In a host uniprocessor system, if the one host CPU is in theinterpretive execution mode such that the guest CPU is operating, noother host CPU exists to invoke the warning track interruption protocol.However, even in this case, the warning track interruption protocol canbe invoked by the CPU itself when the host CPU, while in theinterpretive execution mode, recognizes the timeslice expiration, andcan then grant a grace period and perform the notification.

In a further example of notification, notification occurs when, due toan internal status change recognized by the host CPU when it is in theinterpretive-execution mode, the host CPU causes the notificationdefined in the warning track interruption protocol to be sent to theguest CPU. An example of this occurs when the guest CPU is enabled forthe warning track interruption protocol and the host CPU recognizes theend of the timeslice. Before signaling the guest CPU to relinquishcontrol, the CPU internally grants a grace period to allow the guest CPUsufficient time to receive the signal, to take appropriate action (e.g.,complete the current dispatchable unit or make the current dispatchableunit re-dispatchable), and to voluntarily end. Internally, the host CPUretains state to indicate that the guest CPU has been notified. If theguest does not voluntarily end within the grace period, the CPUrecognizes this and ends execution of the guest, thereby returningcontrol to the host program by ending the interpretive-execution mode.The guest has no way to determine, in one embodiment, why the protocolwas invoked, but only that it was notified to clean up and end. Otherhost rationales may exist for causing an end of interpretive-executionmode, and thus, ending guest execution. For example, scenarios existwhere execution of all guest CPUs are to be stopped in order to makesome coordinated change to the entire guest configuration. Amultiprocessing guest configuration is not to have some CPUs operatingunder different rules or assumptions from other CPUs of the guestconfiguration. Such asymmetry could create unpredictable guest results.

The host CPU receives the effect of the guest CPU having performed thevoluntary exit or exit for any other reason (e.g., the host is returnedthe CPU resource), STEP 508. If the exit is due to what the warningtrack interruption protocol defines, then the host program remembers toprovide a feedback to the guest CPU the next time it is started, howeverlong that may be. This feedback is a positive (“good”) indication,assuming the guest voluntarily exited prior to expiration of the graceperiod. If the exit is due to any other reason, no warning trackinterruption protocol feedback occurs at the next start of the guestCPU.

If the guest is tardy on the voluntary exit; that is, the guest performsan action to voluntarily exit, but the grace period has expired,execution of the guest CPU is preempted by expiration of the graceperiod. The next time the guest CPU is started with a normal timeslice,an exception feedback indication is given so that the guest knows it hadbeen tardy in its voluntary exit. Generally, this can be used forproblem determination in the guest program because the usual graceperiod allows for sufficient time to clean up and voluntarily exit.

If an exit occurs other than the voluntary exit of the warning trackinterruption protocol, the next time the guest CPU is started with anormal timeslice, no feedback per the warning track protocol isincluded.

The means to exit voluntarily is accomplished by any mechanism thatcauses control to pass to the host program from the guest program, whichis recognized by the host program as the protocol voluntary exit, andwhich includes the aforementioned feedback mechanism. In one example, aDiagnose instruction is used for the voluntary exit. That is, theDiagnose instruction with a particular parameter is used to indicatecompletion of the timeslice. After the Diagnose instruction is issued bythe guest program and executed, the host program determines if the exitwas on time. Then, when the guest is started again, which is at the nextsequential instruction after Diagnose, a condition code indicatingwhether it was on time is provided. The condition code is set, forinstance, in the guest PSW that is used to start the guest at the nextsequential instruction. The guest can then test the condition code.

The handling of the guest voluntary exit by the host is furtherdescribed with reference to FIG. 6. Initially, control returns to thehost CPU, when the guest CPU stops, STEP 600. A determination is made asto whether control returned within the grace period, INQUIRY 602. Ifcontrol returned within the grace period, then the host program observesa voluntary guest exit per the warning track interruption protocol andremembers good feedback for the next start of the guest CPU, regardlessof which host CPU might provision the guest CPU at that time, STEP 604.This is assuming the warning track interruption facility is installed.If not, feedback status is not remembered. However, if the guestperforms an action to voluntarily exit but it is outside of the graceperiod, INQUIRY 602, then the host program on the host CPU observes avoluntary guest exit per the warning track interruption protocol (eventhough it was untimely and had to be involuntarily exited) and remembersbad feedback for the next start of the guest CPU, regardless which hostCPU might provision the guest CPU at that time, STEP 606. Again, this isassuming the warning track facility is installed. If not, feedbackstatus is not remembered.

Thereafter, whether the host is remembering good or bad feedback, thehost program redirects the host CPU to a preempting assignment, STEP608. That is, the host is redirected to perform one or more functionsnow that it has its resources (CPU) back.

Moreover, at the next sequential start of the guest CPU, regardless ofwhich host CPU provisions the guest CPU, if feedback status isremembered, the feedback status indication is set prior to starting theguest CPU, STEP 610. In one example, it is set in the SIE statedescription, e.g., in the PSW of the state description, which indicatesthe start of the next sequential instruction.

Further details regarding processing associated with the warning trackinterruption facility are described with reference to FIGS. 7-9. Inparticular, FIG. 7 depicts one embodiment of the logic associated withan overview of the warning track interruption facility processing; FIGS.8A-8C provide details of the warning track interruption facilityprocessing, in accordance with an aspect of the present invention; andFIG. 9 depicts one embodiment of the logic associated with receiving awarning track interruption.

Referring to FIG. 7, initially a guest program (e.g., guest operatingsystem) recognizes that the warning track interruption facility isinstalled, STEP 700. In one embodiment, this is accomplished by theguest program observing an installed facility indicator (e.g., bit) thatis located, for instance, in a designated control block. If the guestoperating system has the support to participate in the warning trackinterruption facility, it recognizes the warning track interruptionfacility installed indicator and then indicates its ability toparticipate in the protocol. In one example, this includes registeringits intent to participate in the warning track processing, STEP 702. Asdescribed herein, in one example, registration is performed via aDiagnose instruction. When registered, the guest operating systemindicates to both the host CPU and the host program that it knows how tohandle a warning track interruption (WTI), which is a non-ambiguousinterrupt which provides a warning to the guest that it is, forinstance, about to lose access to its shared resource (e.g., guest CPU)and that it is, for instance, to take action with respect to itscurrently executing dispatchable unit. Registration is a prerequisite,in one embodiment, for receipt of the WTI. If the guest is notregistered for the warning track interruption facility, upon expirationof the guest's timeslice, no grace period is offered, and the guest CPUis taken out of interpretative execution mode.

Even if registered, in one embodiment, the guest program has twomechanisms to disable presentation of the WTI. For instance, a selectedbit in, for instance, the program status word (PSW) can be set to zerowhich disables presentation of all external interruptions, includingWTI; or a bit in a specified control register (e.g., CR0) can be set tozero to disable just the WTI. When both bits are one, presentation ofthe WTI is enabled. If presentation of a WTI remains disabled for theentire WTI grace period, execution of the guest ends without the benefitof the WTI, which constitutes an involuntary exit.

During interpretive execution of the guest CPU, if the guest CPUinternally recognizes either a host CPU timer external interruptioncondition (e.g., an expired timeslice) or a preemption requested by thehost program, INQUIRY 704, internal CPU processing determines, prior tothe host receiving control, if the warning track interruption processingis to be performed, INQUIRY 706. That is, the internal CPU processingchecks that the guest is enabled for warning track processing andtherefore determines that the warning track processing should beincluded in the processing to be performed. If the warning trackinterruption processing is not to be performed, then interpretiveexecution of the guest ends, STEP 708, and control returns to the hostprogram, STEP 710. Returning to INQUIRY 706, if, however, the warningtrack interruption processing is to be performed, then that processingis performed, as described in further detail below, STEP 712.

Embodiments of further details of the warning track interruptionprocessing are described with reference to FIGS. 8A-8C. In thisprocessing, a number of control indicators are employed including thefollowing:

-   -   A warning track interruption facility grace period active        internal control (e.g., G bit), which is not architecturally        visible, but is used by the internal CPU logic;    -   A warning track interruption (WTI) presented internal control        (e.g., P bit), which indicates, when one, that the WTI has been        presented to the guest and when zero indicates that it has not        been presented. Like the warning track interruption facility        grace period active internal control, the WTI presented internal        control is not architecturally visible, but is used by the        internal CPU logic;    -   A host program preemption of the guest control (e.g., T bit),        which is, for instance, the warning track intervention request        indicator in the guest CPU state description; and    -   Enablement of external interruptions exist, when an E indicator        is one. In one example, the E indicator is a bit within the        current program status word (PSW).

Referring to FIG. 8A, in one example, either a host CPU timerinterruption condition is recognized (e.g., expired timeslice) or awarning track intervention request (e.g., host wants early return of CPUresources; i.e., prior to end of timeslice) is recognized. If a host CPUtimer interruption condition is recognized, INQUIRY 800, a determinationis made as to whether the grace period active control indicator is set(e.g., is G equal to 1), INQUIRY 802. If G is not set, then the Gindicator is set to, for instance, 1, STEP 804, and the warning trackinterruption facility grace period is about to begin. The current valueof the host CPU timer is then saved (the saved value is called theoriginal value herein), STEP 806, and the host CPU timer is set to thewarning track grace period (e.g., 50 microseconds), STEP 808.

Thereafter, a determination is made as to whether the guest is enabledfor a warning track interruption, INQUIRY 810. In one embodiment, ifguest level 2 is active indicating that one guest has started anotherguest, then Guest 2 exits the interpretive execution mode as for a Guest1 interruption, and the Guest 1 Start Interpretive Execution instructionis nullified. Thus, processing is as a Guest 1 at this point. If Guest 2is not active, then processing just continues with the Guest 1. If theguest is enabled for a WTI, then the warning track external interruption(WTI) is presented to the guest, STEP 812. In one example, thisinterruption includes a particular interruption code that is presentedindicating that it has a grace period in order to perform one or morefunctions (e.g., cleanup), if desired.

Further, P is set to 1 indicating that the WTI has been presented, STEP814. Also, the T bit is set to 1 using an interlocked update function(it may have already been 1 if an intervention request had originallybeen used), STEP 816. The grace period in the host CPU timer continuesto be decremented, regardless of whether the WTI was presented, STEP818. This processing is then exited, STEP 820. In one example, adesignation of exiting this process indicates that the CPU has completedthe current processing of the warning track interruption facility and itis returning to other processing as dictated by the current state of theCPU.

Returning to INQUIRY 810, if the guest is not enabled for warning trackinterruption, processing proceeds to STEP 816. In this instance, theguest is not enabled for WTI, so it cannot be presented to the guest.However, the T bit is set pending so that it can be detected later whenthe guest does enable for WTI.

Returning to INQUIRY 800, if it is not a host CPU timer interruptioncondition, then a warning track intervention request is recognized(i.e., host preemption). That is, the T bit in the intervention requestfield of the guest's state description is 1. Thus, a determination ismade as to whether the G indicator is set, INQUIRY 850. If it is not set(e.g., 0), then processing continues with STEP 804. In this situation,the T equals 1 condition is the initial reason to start the WTI process.However, if the G bit is set, then a determination is made as to whetherP is set, INQUIRY 852. If P is not set (e.g., equal to 0), thenprocessing continues with STEP 810 in an attempt to present the WTI.However, if P is set (e.g., not equal to 0), then the discovery of Tequals 1 after the warning track facility grace period has begun has noeffect, and the process is exited, STEP 854.

Returning to INQUIRY 802, if G is set (e.g., equal to 1), the guest CPUhas already been running in the grace period and expiration of the hostCPU timer indicates that the grace period has expired. Thus, a WTI cyclehad previously been initiated and the grace period has expired.Therefore, referring to FIG. 8B, the previously saved original host CPUtimer value is reduced by the amount of time actually used during thegrace period and then loaded into the host CPU timer, STEP 860.Interpretive execution mode is exited, STEP 862, and the host CPU timerexternal interruption is presented to the host, STEP 864 (this is a formof an involuntary guest exit).

In addition to the above, WTI analysis can be initiated via certaininstructions that can enable the CPU for WTI. For instance, referring toFIG. 8C, initially, a number of instructions that can enable the CPU forWTI, including, for instance, a Load PSW (Extended) instruction and aStore Then or System Mask instruction that can set the designated bit inthe PSW, and Load Control that can set the selected bit in the controlregister, perform monitoring, as described herein. For instance, aninstruction that can enable for interrupts checks the T bit forpotential warning track processing. If T=0, INQUIRY 880, then there isno WTI, and this process is exited, STEP 884. However, if T=1, thenprocessing continues with INQUIRY 822.

At INQUIRY 882, a determination is made as to whether P is set (e.g.,equal to 1). If so, then this process is exited, STEP 884, since theenablement had previously been detected. However, if P is not set (e.g.,not equal to 1), then a further determination is made as to whether G isset (e.g., equal to 1), INQUIRY 886. If not, then processing continueswith STEP 804 (FIG. 8A). However, if G is set (e.g., equal to 1), STEP886 (FIG. 8C), then processing continues with INQUIRY 810 in FIG. 8A,STEP 888, and the processing is exited.

Further details of the processing of the warning track interruption aredescribed with reference to FIG. 9. When the guest program receives thewarning track interruption, it performs whatever functions (e.g., OSfunctions) it is to perform in order to, for instance, make thedispatchable unit of work re-dispatchable, STEP 900. For instance, theguest stops the dispatchable unit at a particular point, saves it'sstate, and either moves it to another guest CPU or enables it to bemoved by providing state information, etc. The guest operating systemsignals it has finished by issuing a warning track cleanup completesignal to the host program (a.k.a., a voluntary exit), STEP 902. Thissignal can be any mechanism that causes guest operation to relinquishthe remaining timeslice. However, it is to be recognized by the hostprogram as the cleanup part of the protocol. In one example, a cleanupcompleted function of the Diagnose instruction is used.

If the guest program issues the cleanup completed signal before thegrace period expires, INQUIRY 904, the host program remembers that theguest CPU exited in time, STEP 906. This is a voluntary exit. When theguest CPU is next started, the on-time nature of the signal is indicatedback to the guest CPU, STEP 908. In one example, a guest resumption PSWis set to indicate a successful condition code (e.g., condition code 0).

Returning to INQUIRY 904, if the guest program, for whatever reason,takes too long, the grace period expires by virtue of the host CPU timerhaving decremented the grace period to zero, thus presenting a host CPUtimer external interruption condition to the CPU. In this case, the CPUrecognizes that the guest was already in the grace period and does notgrant another grace period. Instead, guest execution stops and controlreverts to the host program by receipt of the external interruption. Ahost program recognizes that this ending of the guest CPU is aninvoluntary guest exit.

At the next guest CPU start, the guest operating system may then issue acleanup completed signal, albeit now too late. The host program nolonger has an expectation of waiting for receipt of the cleanupcompleted signal. So, the next time the guest CPU is started, the toolate nature of the signal is indicated back to the guest CPU, STEP 912.In one example, the guest resumption PSW is marked to indicate a latecondition, which will be viewed by the guest at the next start. Issue ofa too late Diagnose instruction is sometimes called a stale Diagnoseinstruction because it previously missed exiting within the grace periodand then later exited for no good reason.

In one example, upon a new start of the guest CPU, the guest program cancheck the signal resumption part of the protocol for whether the signalhad or had not been issued within the grace period. The guest programcan use this information to investigate why it might have been delayedand make improvements to improve the statistics of being more timely inthe future.

In one embodiment, when the guest is disabled for all externalinterruptions, a number of instructions that can enable externalinterruptions perform monitoring. When the guest is enabled for externalinterruptions, a WTI enablement is examined. At this point, if WTI isenabled and the P bit is 0, the WTI is presented to the guest CPU.

As mentioned above, in one embodiment, a Diagnose function is used toindicate cleanup is completed or to register for the warning trackinterruption facility. For cleanup completed, the Diagnose function,when issued with a cleanup parameter and executed, signals that theissuing CPU has performed any desired processing associated with thereceipt of a warning track external interruption. When executioncompletes, a condition code is set indicating whether completion wasissued within the model-dependent time interval allowed for cleanupafter the warning track interruption or not.

As for the register function, the Diagnose function, when issued withthe register parameter and executed, signals that the issuingconfiguration understands the warning track interruption. When executioncompletes, a successful condition code is set. The registration statusis cleared by a system reset.

One embodiment of a format of a Diagnose instruction is described withreference to FIG. 10. In one embodiment, a Diagnose instruction 1000includes an opcode 1002 indicating the Diagnose function; a firstregister field 1004 (R₁); a second register field 1006 (R₃); a generalregister field 1008 (B₂); and a displacement field 1010 (D₂). In oneexample, the contents of the D₂ field are added to the contents ofgeneral register B₂. The result is not used to address data, butinstead, certain bits (e.g., bits 48-63) are used as an operation codeextension. When the operation code extension is a predetermined value,warning track cleanup completed is specified and a timeslice isrelinquished.

In one example, the R₃ field is unused and it contains zeros. Further,specified bits of general register R₁ are unused and are to containzeros and a particular bit of general register R₁ (e.g., bit 63)specifies the cleanup completed function when zero and the registerfunction when 1.

In a logical partition using shared physical CPUs, this function mayimprove system performance by allowing the physical CPU on which thelogical CPU is running to be assigned to another logical CPU.

Beyond Diagnose, any other SIE exit while in the WTI grace interval,whatever the cause, similarly restores the original value of the hostCPU timer decremented by the amount of grace period time expended.

Described in detail herein is a warning track interruption facility thatprovides, in one embodiment, a mechanism by which a warning trackexternal interruption can be presented to a CPU in a configuration withshared CPU resources, such as a logical partition. The control programcan use the warning track external interruption as the signal to makethe currently executing dispatchable unit dispatchable on a differentCPU on the configuration.

In one embodiment, a logical (guest) processor running in a timeslice ona physical processor receives a warning signal indicating a graceperiod, e.g., an amount of time before the logical processor will beinterrupted (deallocated from the physical processor that may be shared)enabling the work being done by the logical processor to be eithercompleted or moved to another logical processor. As an example, theguest CPU is signaled that it's timeslice is expired and that it shouldpreempt the current dispatchable unit of work (DU) to make itre-dispatchable on another guest CPU. In one example, the warning signalis an interruption having an interruption code that indicates it is aWTI. In a further example, the interruption code includes informationabout the amount of time or other period given to the grace period.

In one embodiment, the warning track interruption facility can be usedin non-virtual, as well as virtual environments, in which one programand/or processor shares resources (e.g., CPU resources, or otherresources) with one or more other programs and/or processors.

In one embodiment, in which the environment is a virtual environment,from a guest's perspective the:

-   -   1. Guest program observes the installed condition of the warning        track interruption protocol facility.    -   2. Guest program registers for the warning track interruption        protocol.    -   3. Guest CPU receives a warning track notification, according to        the particular architecture (e.g., shared memory indication,        shared I/O device indication, interruption).    -   4. Guest program executing on the guest CPU performs applicable        processing according to the nature of the guest program having        received the notification (processing of notification expected        to be unique per operating system).    -   5. Guest CPU relinquishes control according to the warning track        protocol voluntary technique.    -   6. At next start of guest CPU, guest program may observe        feedback, according to warning track protocol.

Further, in one embodiment, from the host's perspective:

-   -   A. Host program observes the installed condition of the warning        track interruption protocol facility.        -   1. Host program acquires the warning track interruption            protocol facility installed indication.        -   2. Host program persistently remembers the installed status            of the warning track interruption protocol.        -   3. Host program indicates the warning track protocol            installed status to each guest configuration.        -   4. Host program disables the warning track protocol in all            unregistered guest CPUs.        -   5. Host program prepares to recognize a guest warning track            registration request from each guest configuration.    -   B. Host program recognizes a warning track registration request        from a guest.        -   1. Host program persistently remembers that the guest            configuration understands the warning track protocol.        -   2. Host program enables guest for warning track protocol.    -   C. During normal guest CPU X operation, preemption of the guest        CPU X is used to re-acquire the corresponding host CPU X.        -   1. Host program in CPU Y signals notification to guest CPU            X.            -   a. CPU X propagates notification to guest CPU X via                update of shared memory location, update of shared I/O                device, or interruption to guest CPU X, according to                warning track protocol.    -   D. Guest CPU X stops, returning control to host CPU X.        -   1. If within grace period, host program on CPU X observes            voluntary guest exit per warning track protocol and            remembers good feedback for next start of guest CPU X,            regardless of which host CPU might provision guest CPU X at            that time.            -   a. If within grace period, but exit of guest CPU X is                not according to the warning track protocol, feedback                status is not remembered.        -   2. If not within grace period, host program on CPU X            observes voluntary guest exit per warning track protocol and            remembers bad feedback for next start of guest CPU X,            regardless of which host CPU might provision guest CPU X at            that time.            -   a. If not within grace period, but exit of guest CPU X                is not according to the warning track protocol, feedback                status is not remembered.        -   3. Host program on host CPU X redirects CPU X to preempting            assignment.    -   E. Next sequential start of guest CPU X, regardless of which        host CPU provisions guest CPU X, if feedback status is        remembered, set feedback indication, according to the warning        track protocol before starting the guest CPU X.

In one embodiment, a guest processor of the guest configuration receivesa unique interruption, that interruption being defined for a computerarchitecture, and the meaning of the interruption being a warning trackinterruption. The interruption indicates a specific code whichidentifies the interruption as a warning track interruption. Theinterruption implies a relatively short time interval, referred to as agrace period, leading up to ending a guest processor execution.

During the grace period, in one example, the guest program is nominallyexpected to make the current dispatchable unit of work re-dispatchableon another guest processor, thus avoiding being stuck on the currentguest processor, awaiting its next, normal timeslice start from thehost.

In one example, the relatively short time interval is granted only onceper host program start of the guest processor. The time interval isgranted from, for instance, the existing time interval under which theguest processor is running Since the granted time interval is allocatedfrom the normal remaining timeslice, it is not borrowing time, per se,but is using a constrained amount of time from the current time intervalto ensure that the guest processor is indeed preempted in a relativelyshort period of time.

In a further example in which the current timeslice has expired, thetime interval is granted as extra time in addition to the existing timeinterval under which the guest processor is running. The granted timeinterval is accounted for by the host program as against the expectednext, sequential normal time interval that will be consumed by the guestprocessor under which the guest processor is expected to next berunning. It is still intended to ensure that the guest processor isindeed preempted in a relatively short period of time.

In one example, an interruption request for a warning track event may begenerated to inform the program it is nearing the end of the currentexecution interval on a shared CPU. The interruption request is apending-condition type which is generated when the configuration isregistered and is enabled for the warning track interruption facility.

The cooperative processing between the programs (e.g., host and guest)optimizes resource sharing (e.g., CPU) among programs (e.g., guestoperating systems). One or more aspects provide, for instance, betterresponse time with the same CPU utilization. Further, systemserialization is released prior to undispatch by the hypervisor.

In a further embodiment, one or more aspects of the invention can beused with requests from an operating system to let an individualexecution thread continue to improve elapsed time of time sensitivework. That is, a thread may request or be provided additional time toperform a function.

As will be appreciated by one skilled in the art, one or more aspects ofthe present invention may be embodied as a system, method or computerprogram product. Accordingly, one or more aspects of the presentinvention may take the form of an entirely hardware embodiment, anentirely software embodiment (including firmware, resident software,micro-code, etc.) or an embodiment combining software and hardwareaspects that may all generally be referred to herein as a “circuit,”“module” or “system”. Furthermore, one or more aspects of the presentinvention may take the form of a computer program product embodied inone or more computer readable medium(s) having computer readable programcode embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readablestorage medium. A computer readable storage medium may be, for example,but not limited to, an electronic, magnetic, optical, electromagnetic,infrared or semiconductor system, apparatus, or device, or any suitablecombination of the foregoing. More specific examples (a non-exhaustivelist) of the computer readable storage medium include the following: anelectrical connection having one or more wires, a portable computerdiskette, a hard disk, a random access memory (RAM), a read-only memory(ROM), an erasable programmable read-only memory (EPROM or Flashmemory), an optical fiber, a portable compact disc read-only memory(CD-ROM), an optical storage device, a magnetic storage device, or anysuitable combination of the foregoing. In the context of this document,a computer readable storage medium may be any tangible medium that cancontain or store a program for use by or in connection with aninstruction execution system, apparatus, or device.

Referring now to FIG. 11, in one example, a computer program product1100 includes, for instance, one or more non-transitory computerreadable storage media 1102 to store computer readable program codemeans or logic 1104 thereon to provide and facilitate one or moreaspects of the present invention.

Program code embodied on a computer readable medium may be transmittedusing an appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for one or moreaspects of the present invention may be written in any combination ofone or more programming languages, including an object orientedprogramming language, such as Java, Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language, assembler or similar programming languages. Theprogram code may execute entirely on the user's computer, partly on theuser's computer, as a stand-alone software package, partly on the user'scomputer and partly on a remote computer or entirely on the remotecomputer or server. In the latter scenario, the remote computer may beconnected to the user's computer through any type of network, includinga local area network (LAN) or a wide area network (WAN), or theconnection may be made to an external computer (for example, through theInternet using an Internet Service Provider).

One or more aspects of the present invention are described herein withreference to flowchart illustrations and/or block diagrams of methods,apparatus (systems) and computer program products according toembodiments of the invention. It will be understood that each block ofthe flowchart illustrations and/or block diagrams, and combinations ofblocks in the flowchart illustrations and/or block diagrams, can beimplemented by computer program instructions. These computer programinstructions may be provided to a processor of a general purposecomputer, special purpose computer, or other programmable dataprocessing apparatus to produce a machine, such that the instructions,which execute via the processor of the computer or other programmabledata processing apparatus, create means for implementing thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The flowchart and block diagrams in the figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of one or more aspects of the present invention. In thisregard, each block in the flowchart or block diagrams may represent amodule, segment, or portion of code, which comprises one or moreexecutable instructions for implementing the specified logicalfunction(s). It should also be noted that, in some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts, or combinations of special purpose hardware andcomputer instructions.

In addition to the above, one or more aspects of the present inventionmay be provided, offered, deployed, managed, serviced, etc. by a serviceprovider who offers management of customer environments. For instance,the service provider can create, maintain, support, etc. computer codeand/or a computer infrastructure that performs one or more aspects ofthe present invention for one or more customers. In return, the serviceprovider may receive payment from the customer under a subscriptionand/or fee agreement, as examples. Additionally or alternatively, theservice provider may receive payment from the sale of advertisingcontent to one or more third parties.

In one aspect of the present invention, an application may be deployedfor performing one or more aspects of the present invention. As oneexample, the deploying of an application comprises providing computerinfrastructure operable to perform one or more aspects of the presentinvention.

As a further aspect of the present invention, a computing infrastructuremay be deployed comprising integrating computer readable code into acomputing system, in which the code in combination with the computingsystem is capable of performing one or more aspects of the presentinvention.

As yet a further aspect of the present invention, a process forintegrating computing infrastructure comprising integrating computerreadable code into a computer system may be provided. The computersystem comprises a computer readable medium, in which the computermedium comprises one or more aspects of the present invention. The codein combination with the computer system is capable of performing one ormore aspects of the present invention.

Although various embodiments are described above, these are onlyexamples. For example, computing environments of other architectures canincorporate and use one or more aspects of the present invention.Further, the grace period may be other than an amount of time, such as anumber of instructions or cycles or any other quantifiable value. Manychanges and/or additions may be made without departing from the spiritof the present invention.

Further, other types of computing environments can benefit from one ormore aspects of the present invention. As an example, a data processingsystem suitable for storing and/or executing program code is usable thatincludes at least two processors coupled directly or indirectly tomemory elements through a system bus. The memory elements include, forinstance, local memory employed during actual execution of the programcode, bulk storage, and cache memory which provide temporary storage ofat least some program code in order to reduce the number of times codemust be retrieved from bulk storage during execution.

Input/Output or I/O devices (including, but not limited to, keyboards,displays, pointing devices, DASD, tape, CDs, DVDs, thumb drives andother memory media, etc.) can be coupled to the system either directlyor through intervening I/O controllers. Network adapters may also becoupled to the system to enable the data processing system to becomecoupled to other data processing systems or remote printers or storagedevices through intervening private or public networks. Modems, cablemodems, and Ethernet cards are just a few of the available types ofnetwork adapters.

Other examples of computing environments that may incorporate and/or useone or more aspects of the present invention are described below.

Referring to FIG. 12, representative components of a Host Computersystem 5000 to implement one or more aspects of the present inventionare portrayed. The representative host computer 5000 comprises one ormore CPUs 5001 in communication with computer memory (i.e., centralstorage) 5002, as well as I/O interfaces to storage media devices 5011and networks 5010 for communicating with other computers or SANs and thelike. The CPU 5001 is compliant with an architecture having anarchitected instruction set and architected functionality. The CPU 5001may have dynamic address translation (DAT) 5003 for transforming programaddresses (virtual addresses) into real addresses of memory. A DATtypically includes a translation lookaside buffer (TLB) 5007 for cachingtranslations so that later accesses to the block of computer memory 5002do not require the delay of address translation. Typically, a cache 5009is employed between computer memory 5002 and the processor 5001. Thecache 5009 may be hierarchical having a large cache available to morethan one CPU and smaller, faster (lower level) caches between the largecache and each CPU. In some implementations, the lower level caches aresplit to provide separate low level caches for instruction fetching anddata accesses. In one embodiment, an instruction is fetched from memory5002 by an instruction fetch unit 5004 via a cache 5009. The instructionis decoded in an instruction decode unit 5006 and dispatched (with otherinstructions in some embodiments) to instruction execution unit or units5008. Typically several execution units 5008 are employed, for examplean arithmetic execution unit, a floating point execution unit and abranch instruction execution unit. The instruction is executed by theexecution unit, accessing operands from instruction specified registersor memory as needed. If an operand is to be accessed (loaded or stored)from memory 5002, a load/store unit 5005 typically handles the accessunder control of the instruction being executed. Instructions may beexecuted in hardware circuits or in internal microcode (firmware) or bya combination of both.

As noted, a computer system includes information in local (or main)storage, as well as addressing, protection, and reference and changerecording. Some aspects of addressing include the format of addresses,the concept of address spaces, the various types of addresses, and themanner in which one type of address is translated to another type ofaddress. Some of main storage includes permanently assigned storagelocations. Main storage provides the system with directly addressablefast-access storage of data. Both data and programs are to be loadedinto main storage (from input devices) before they can be processed.

Main storage may include one or more smaller, faster-access bufferstorages, sometimes called caches. A cache is typically physicallyassociated with a CPU or an I/O processor. The effects, except onperformance, of the physical construction and use of distinct storagemedia are generally not observable by the program.

Separate caches may be maintained for instructions and for dataoperands. Information within a cache is maintained in contiguous byteson an integral boundary called a cache block or cache line (or line, forshort). A model may provide an EXTRACT CACHE ATTRIBUTE instruction whichreturns the size of a cache line in bytes. A model may also providePREFETCH DATA and PREFETCH DATA RELATIVE LONG instructions which effectsthe prefetching of storage into the data or instruction cache or thereleasing of data from the cache.

Storage is viewed as a long horizontal string of bits. For mostoperations, accesses to storage proceed in a left-to-right sequence. Thestring of bits is subdivided into units of eight bits. An eight-bit unitis called a byte, which is the basic building block of all informationformats. Each byte location in storage is identified by a uniquenonnegative integer, which is the address of that byte location or,simply, the byte address. Adjacent byte locations have consecutiveaddresses, starting with 0 on the left and proceeding in a left-to-rightsequence. Addresses are unsigned binary integers and are 24, 31, or 64bits.

Information is transmitted between storage and a CPU or a channelsubsystem one byte, or a group of bytes, at a time. Unless otherwisespecified, in, for instance, the z/Architecture®, a group of bytes instorage is addressed by the leftmost byte of the group. The number ofbytes in the group is either implied or explicitly specified by theoperation to be performed. When used in a CPU operation, a group ofbytes is called a field. Within each group of bytes, in, for instance,the z/Architecture®, bits are numbered in a left-to-right sequence. Inthe z/Architecture®, the leftmost bits are sometimes referred to as the“high-order” bits and the rightmost bits as the “low-order” bits. Bitnumbers are not storage addresses, however. Only bytes can be addressed.To operate on individual bits of a byte in storage, the entire byte isaccessed. The bits in a byte are numbered 0 through 7, from left toright (in, e.g., the z/Architecture®). The bits in an address may benumbered 8-31 or 40-63 for 24-bit addresses, or 1-31 or 33-63 for 31-bitaddresses; they are numbered 0-63 for 64-bit addresses. Within any otherfixed-length format of multiple bytes, the bits making up the format areconsecutively numbered starting from 0. For purposes of error detection,and in preferably for correction, one or more check bits may betransmitted with each byte or with a group of bytes. Such check bits aregenerated automatically by the machine and cannot be directly controlledby the program. Storage capacities are expressed in number of bytes.When the length of a storage-operand field is implied by the operationcode of an instruction, the field is said to have a fixed length, whichcan be one, two, four, eight, or sixteen bytes. Larger fields may beimplied for some instructions. When the length of a storage-operandfield is not implied but is stated explicitly, the field is said to havea variable length. Variable-length operands can vary in length byincrements of one byte (or with some instructions, in multiples of twobytes or other multiples). When information is placed in storage, thecontents of only those byte locations are replaced that are included inthe designated field, even though the width of the physical path tostorage may be greater than the length of the field being stored.

Certain units of information are to be on an integral boundary instorage. A boundary is called integral for a unit of information whenits storage address is a multiple of the length of the unit in bytes.Special names are given to fields of 2, 4, 8, and 16 bytes on anintegral boundary. A halfword is a group of two consecutive bytes on atwo-byte boundary and is the basic building block of instructions. Aword is a group of four consecutive bytes on a four-byte boundary. Adoubleword is a group of eight consecutive bytes on an eight-byteboundary. A quadword is a group of 16 consecutive bytes on a 16-byteboundary. When storage addresses designate halfwords, words,doublewords, and quadwords, the binary representation of the addresscontains one, two, three, or four rightmost zero bits, respectively.Instructions are to be on two-byte integral boundaries. The storageoperands of most instructions do not have boundary-alignmentrequirements.

On devices that implement separate caches for instructions and dataoperands, a significant delay may be experienced if the program storesinto a cache line from which instructions are subsequently fetched,regardless of whether the store alters the instructions that aresubsequently fetched.

In one embodiment, the invention may be practiced by software (sometimesreferred to licensed internal code, firmware, micro-code, milli-code,pico-code and the like, any of which would be consistent with one ormore aspects the present invention). Referring to FIG. 12, softwareprogram code which embodies one or more aspects of the present inventionmay be accessed by processor 5001 of the host system 5000 from long-termstorage media devices 5011, such as a CD-ROM drive, tape drive or harddrive. The software program code may be embodied on any of a variety ofknown media for use with a data processing system, such as a diskette,hard drive, or CD-ROM. The code may be distributed on such media, or maybe distributed to users from computer memory 5002 or storage of onecomputer system over a network 5010 to other computer systems for use byusers of such other systems.

The software program code includes an operating system which controlsthe function and interaction of the various computer components and oneor more application programs. Program code is normally paged fromstorage media device 5011 to the relatively higher-speed computerstorage 5002 where it is available for processing by processor 5001. Thetechniques and methods for embodying software program code in memory, onphysical media, and/or distributing software code via networks are wellknown and will not be further discussed herein. Program code, whencreated and stored on a tangible medium (including but not limited toelectronic memory modules (RAM), flash memory, Compact Discs (CDs),DVDs, Magnetic Tape and the like is often referred to as a “computerprogram product”. The computer program product medium is typicallyreadable by a processing circuit preferably in a computer system forexecution by the processing circuit.

FIG. 13 illustrates a representative workstation or server hardwaresystem in which one or more aspects of the present invention may bepracticed. The system 5020 of FIG. 13 comprises a representative basecomputer system 5021, such as a personal computer, a workstation or aserver, including optional peripheral devices. The base computer system5021 includes one or more processors 5026 and a bus employed to connectand enable communication between the processor(s) 5026 and the othercomponents of the system 5021 in accordance with known techniques. Thebus connects the processor 5026 to memory 5025 and long-term storage5027 which can include a hard drive (including any of magnetic media,CD, DVD and Flash Memory for example) or a tape drive for example. Thesystem 5021 might also include a user interface adapter, which connectsthe microprocessor 5026 via the bus to one or more interface devices,such as a keyboard 5024, a mouse 5023, a printer/scanner 5030 and/orother interface devices, which can be any user interface device, such asa touch sensitive screen, digitized entry pad, etc. The bus alsoconnects a display device 5022, such as an LCD screen or monitor, to themicroprocessor 5026 via a display adapter.

The system 5021 may communicate with other computers or networks ofcomputers by way of a network adapter capable of communicating 5028 witha network 5029. Example network adapters are communications channels,token ring, Ethernet or modems. Alternatively, the system 5021 maycommunicate using a wireless interface, such as a CDPD (cellular digitalpacket data) card. The system 5021 may be associated with such othercomputers in a Local Area Network (LAN) or a Wide Area Network (WAN), orthe system 5021 can be a client in a client/server arrangement withanother computer, etc. All of these configurations, as well as theappropriate communications hardware and software, are known in the art.

FIG. 14 illustrates a data processing network 5040 in which one or moreaspects of the present invention may be practiced. The data processingnetwork 5040 may include a plurality of individual networks, such as awireless network and a wired network, each of which may include aplurality of individual workstations 5041, 5042, 5043, 5044.Additionally, as those skilled in the art will appreciate, one or moreLANs may be included, where a LAN may comprise a plurality ofintelligent workstations coupled to a host processor.

Still referring to FIG. 14, the networks may also include mainframecomputers or servers, such as a gateway computer (client server 5046) orapplication server (remote server 5048 which may access a datarepository and may also be accessed directly from a workstation 5045). Agateway computer 5046 serves as a point of entry into each individualnetwork. A gateway is needed when connecting one networking protocol toanother. The gateway 5046 may be preferably coupled to another network(the Internet 5047 for example) by means of a communications link. Thegateway 5046 may also be directly coupled to one or more workstations5041, 5042, 5043, 5044 using a communications link. The gateway computermay be implemented utilizing an IBM eServer™ System Z® server availablefrom International Business Machines Corporation.

Referring concurrently to FIG. 13 and FIG. 14, software programming codewhich may embody one or more aspects of the present invention may beaccessed by the processor 5026 of the system 5020 from long-term storagemedia 5027, such as a CD-ROM drive or hard drive. The softwareprogramming code may be embodied on any of a variety of known media foruse with a data processing system, such as a diskette, hard drive, orCD-ROM. The code may be distributed on such media, or may be distributedto users 5050, 5051 from the memory or storage of one computer systemover a network to other computer systems for use by users of such othersystems.

Alternatively, the programming code may be embodied in the memory 5025,and accessed by the processor 5026 using the processor bus. Suchprogramming code includes an operating system which controls thefunction and interaction of the various computer components and one ormore application programs 5032. Program code is normally paged fromstorage media 5027 to high-speed memory 5025 where it is available forprocessing by the processor 5026. The techniques and methods forembodying software programming code in memory, on physical media, and/ordistributing software code via networks are well known and will not befurther discussed herein. Program code, when created and stored on atangible medium (including but not limited to electronic memory modules(RAM), flash memory, Compact Discs (CDs), DVDs, Magnetic Tape and thelike is often referred to as a “computer program product”. The computerprogram product medium is typically readable by a processing circuitpreferably in a computer system for execution by the processing circuit.

The cache that is most readily available to the processor (normallyfaster and smaller than other caches of the processor) is the lowest (L1or level one) cache and main store (main memory) is the highest levelcache (L3 if there are 3 levels). The lowest level cache is oftendivided into an instruction cache (I-Cache) holding machine instructionsto be executed and a data cache (D-Cache) holding data operands.

Referring to FIG. 15, an exemplary processor embodiment is depicted forprocessor 5026. Typically one or more levels of cache 5053 are employedto buffer memory blocks in order to improve processor performance. Thecache 5053 is a high speed buffer holding cache lines of memory datathat are likely to be used. Typical cache lines are 64, 128 or 256 bytesof memory data. Separate caches are often employed for cachinginstructions than for caching data. Cache coherence (synchronization ofcopies of lines in memory and the caches) is often provided by various“snoop” algorithms well known in the art. Main memory storage 5025 of aprocessor system is often referred to as a cache. In a processor systemhaving 4 levels of cache 5053, main storage 5025 is sometimes referredto as the level 5 (L5) cache since it is typically faster and only holdsa portion of the non-volatile storage (DASD, tape etc) that is availableto a computer system. Main storage 5025 “caches” pages of data paged inand out of the main storage 5025 by the operating system.

A program counter (instruction counter) 5061 keeps track of the addressof the current instruction to be executed. A program counter in az/Architecture® processor is 64 bits and can be truncated to 31 or 24bits to support prior addressing limits. A program counter is typicallyembodied in a PSW (program status word) of a computer such that itpersists during context switching. Thus, a program in progress, having aprogram counter value, may be interrupted by, for example, the operatingsystem (context switch from the program environment to the operatingsystem environment). The PSW of the program maintains the programcounter value while the program is not active, and the program counter(in the PSW) of the operating system is used while the operating systemis executing. Typically, the program counter is incremented by an amountequal to the number of bytes of the current instruction. RISC (ReducedInstruction Set Computing) instructions are typically fixed length whileCISC (Complex Instruction Set Computing) instructions are typicallyvariable length. Instructions of the IBM z/Architecture® are CISCinstructions having a length of 2, 4 or 6 bytes. The Program counter5061 is modified by either a context switch operation or a branch takenoperation of a branch instruction for example. In a context switchoperation, the current program counter value is saved in the programstatus word along with other state information about the program beingexecuted (such as condition codes), and a new program counter value isloaded pointing to an instruction of a new program module to beexecuted. A branch taken operation is performed in order to permit theprogram to make decisions or loop within the program by loading theresult of the branch instruction into the program counter 5061.

Typically an instruction fetch unit 5055 is employed to fetchinstructions on behalf of the processor 5026. The fetch unit eitherfetches “next sequential instructions”, target instructions of branchtaken instructions, or first instructions of a program following acontext switch. Modern Instruction fetch units often employ prefetchtechniques to speculatively prefetch instructions based on thelikelihood that the prefetched instructions might be used. For example,a fetch unit may fetch 16 bytes of instruction that includes the nextsequential instruction and additional bytes of further sequentialinstructions.

The fetched instructions are then executed by the processor 5026. In anembodiment, the fetched instruction(s) are passed to a dispatch unit5056 of the fetch unit. The dispatch unit decodes the instruction(s) andforwards information about the decoded instruction(s) to appropriateunits 5057, 5058, 5060. An execution unit 5057 will typically receiveinformation about decoded arithmetic instructions from the instructionfetch unit 5055 and will perform arithmetic operations on operandsaccording to the opcode of the instruction. Operands are provided to theexecution unit 5057 preferably either from memory 5025, architectedregisters 5059 or from an immediate field of the instruction beingexecuted. Results of the execution, when stored, are stored either inmemory 5025, registers 5059 or in other machine hardware (such ascontrol registers, PSW registers and the like).

A processor 5026 typically has one or more units 5057, 5058, 5060 forexecuting the function of the instruction. Referring to FIG. 16A, anexecution unit 5057 may communicate with architected general registers5059, a decode/dispatch unit 5056, a load store unit 5060, and other5065 processor units by way of interfacing logic 5071. An execution unit5057 may employ several register circuits 5067, 5068, 5069 to holdinformation that the arithmetic logic unit (ALU) 5066 will operate on.The ALU performs arithmetic operations such as add, subtract, multiplyand divide as well as logical function such as and, or and exclusive-or(XOR), rotate and shift. Preferably the ALU supports specializedoperations that are design dependent. Other circuits may provide otherarchitected facilities 5072 including condition codes and recoverysupport logic for example. Typically the result of an ALU operation isheld in an output register circuit 5070 which can forward the result toa variety of other processing functions. There are many arrangements ofprocessor units, the present description is only intended to provide arepresentative understanding of one embodiment.

An ADD instruction for example would be executed in an execution unit5057 having arithmetic and logical functionality while a floating pointinstruction for example would be executed in a floating point executionhaving specialized floating point capability. Preferably, an executionunit operates on operands identified by an instruction by performing anopcode defined function on the operands. For example, an ADD instructionmay be executed by an execution unit 5057 on operands found in tworegisters 5059 identified by register fields of the instruction.

The execution unit 5057 performs the arithmetic addition on two operandsand stores the result in a third operand where the third operand may bea third register or one of the two source registers. The execution unitpreferably utilizes an Arithmetic Logic Unit (ALU) 5066 that is capableof performing a variety of logical functions such as Shift, Rotate, And,Or and XOR as well as a variety of algebraic functions including any ofadd, subtract, multiply, divide. Some ALUs 5066 are designed for scalaroperations and some for floating point. Data may be Big Endian (wherethe least significant byte is at the highest byte address) or LittleEndian (where the least significant byte is at the lowest byte address)depending on architecture. The IBM z/Architecture® is Big Endian. Signedfields may be sign and magnitude, 1's complement or 2's complementdepending on architecture. A 2's complement number is advantageous inthat the ALU does not need to design a subtract capability since eithera negative value or a positive value in 2's complement requires only anaddition within the ALU. Numbers are commonly described in shorthand,where a 12 bit field defines an address of a 4,096 byte block and iscommonly described as a 4 Kbyte (Kilo-byte) block, for example.

Referring to FIG. 16B, branch instruction information for executing abranch instruction is typically sent to a branch unit 5058 which oftenemploys a branch prediction algorithm such as a branch history table5082 to predict the outcome of the branch before other conditionaloperations are complete. The target of the current branch instructionwill be fetched and speculatively executed before the conditionaloperations are complete. When the conditional operations are completedthe speculatively executed branch instructions are either completed ordiscarded based on the conditions of the conditional operation and thespeculated outcome. A typical branch instruction may test conditioncodes and branch to a target address if the condition codes meet thebranch requirement of the branch instruction, a target address may becalculated based on several numbers including ones found in registerfields or an immediate field of the instruction for example. The branchunit 5058 may employ an ALU 5074 having a plurality of input registercircuits 5075, 5076, 5077 and an output register circuit 5080. Thebranch unit 5058 may communicate with general registers 5059, decodedispatch unit 5056 or other circuits 5073, for example.

The execution of a group of instructions can be interrupted for avariety of reasons including a context switch initiated by an operatingsystem, a program exception or error causing a context switch, an I/Ointerruption signal causing a context switch or multi-threading activityof a plurality of programs (in a multi-threaded environment), forexample. Preferably a context switch action saves state informationabout a currently executing program and then loads state informationabout another program being invoked. State information may be saved inhardware registers or in memory for example. State informationpreferably comprises a program counter value pointing to a nextinstruction to be executed, condition codes, memory translationinformation and architected register content. A context switch activitycan be exercised by hardware circuits, application programs, operatingsystem programs or firmware code (microcode, pico-code or licensedinternal code (LIC)) alone or in combination.

A processor accesses operands according to instruction defined methods.The instruction may provide an immediate operand using the value of aportion of the instruction, may provide one or more register fieldsexplicitly pointing to either general purpose registers or specialpurpose registers (floating point registers for example). Theinstruction may utilize implied registers identified by an opcode fieldas operands. The instruction may utilize memory locations for operands.A memory location of an operand may be provided by a register, animmediate field, or a combination of registers and immediate field asexemplified by the z/Architecture® long displacement facility whereinthe instruction defines a base register, an index register and animmediate field (displacement field) that are added together to providethe address of the operand in memory for example. Location hereintypically implies a location in main memory (main storage) unlessotherwise indicated.

Referring to FIG. 16C, a processor accesses storage using a load/storeunit 5060. The load/store unit 5060 may perform a load operation byobtaining the address of the target operand in memory 5053 and loadingthe operand in a register 5059 or another memory 5053 location, or mayperform a store operation by obtaining the address of the target operandin memory 5053 and storing data obtained from a register 5059 or anothermemory 5053 location in the target operand location in memory 5053. Theload/store unit 5060 may be speculative and may access memory in asequence that is out-of-order relative to instruction sequence, howeverthe load/store unit 5060 is to maintain the appearance to programs thatinstructions were executed in order. A load/store unit 5060 maycommunicate with general registers 5059, decode/dispatch unit 5056,cache/memory interface 5053 or other elements 5083 and comprises variousregister circuits, ALUs 5085 and control logic 5090 to calculate storageaddresses and to provide pipeline sequencing to keep operationsin-order. Some operations may be out of order but the load/store unitprovides functionality to make the out of order operations to appear tothe program as having been performed in order, as is well known in theart.

Preferably addresses that an application program “sees” are oftenreferred to as virtual addresses. Virtual addresses are sometimesreferred to as “logical addresses” and “effective addresses”. Thesevirtual addresses are virtual in that they are redirected to physicalmemory location by one of a variety of dynamic address translation (DAT)technologies including, but not limited to, simply prefixing a virtualaddress with an offset value, translating the virtual address via one ormore translation tables, the translation tables preferably comprising atleast a segment table and a page table alone or in combination,preferably, the segment table having an entry pointing to the pagetable. In the z/Architecture®, a hierarchy of translation is providedincluding a region first table, a region second table, a region thirdtable, a segment table and an optional page table. The performance ofthe address translation is often improved by utilizing a translationlookaside buffer (TLB) which comprises entries mapping a virtual addressto an associated physical memory location. The entries are created whenthe DAT translates a virtual address using the translation tables.Subsequent use of the virtual address can then utilize the entry of thefast TLB rather than the slow sequential translation table accesses. TLBcontent may be managed by a variety of replacement algorithms includingLRU (Least Recently used).

In the case where the processor is a processor of a multi-processorsystem, each processor has responsibility to keep shared resources, suchas I/O, caches, TLBs and memory, interlocked for coherency. Typically,“snoop” technologies will be utilized in maintaining cache coherency. Ina snoop environment, each cache line may be marked as being in any oneof a shared state, an exclusive state, a changed state, an invalid stateand the like in order to facilitate sharing.

I/O units 5054 (FIG. 15) provide the processor with means for attachingto peripheral devices including tape, disc, printers, displays, andnetworks for example. I/O units are often presented to the computerprogram by software drivers. In mainframes, such as the System Z® fromIBM®, channel adapters and open system adapters are I/O units of themainframe that provide the communications between the operating systemand peripheral devices.

Further, other types of computing environments can benefit from one ormore aspects of the present invention. As an example, as mentionedherein, an environment may include an emulator (e.g., software or otheremulation mechanisms), in which a particular architecture (including,for instance, instruction execution, architected functions, such asaddress translation, and architected registers) or a subset thereof isemulated (e.g., on a native computer system having a processor andmemory). In such an environment, one or more emulation functions of theemulator can implement one or more aspects of the present invention,even though a computer executing the emulator may have a differentarchitecture than the capabilities being emulated. As one example, inemulation mode, the specific instruction or operation being emulated isdecoded, and an appropriate emulation function is built to implement theindividual instruction or operation.

In an emulation environment, a host computer includes, for instance, amemory to store instructions and data; an instruction fetch unit tofetch instructions from memory and to optionally, provide localbuffering for the fetched instruction; an instruction decode unit toreceive the fetched instructions and to determine the type ofinstructions that have been fetched; and an instruction execution unitto execute the instructions. Execution may include loading data into aregister from memory; storing data back to memory from a register; orperforming some type of arithmetic or logical operation, as determinedby the decode unit. In one example, each unit is implemented insoftware. For instance, the operations being performed by the units areimplemented as one or more subroutines within emulator software.

More particularly, in a mainframe, architected machine instructions areused by programmers, usually today “C” programmers, often by way of acompiler application. These instructions stored in the storage mediummay be executed natively in a z/Architecture® IBM® Server, oralternatively in machines executing other architectures. They can beemulated in the existing and in future IBM® mainframe servers and onother machines of IBM® (e.g., Power Systems servers and System X®Servers). They can be executed in machines running Linux on a widevariety of machines using hardware manufactured by IBM®, Intel®, AMD™,and others. Besides execution on that hardware under a z/Architecture®,Linux can be used as well as machines which use emulation by Hercules,UMX, or FSI (Fundamental Software, Inc), where generally execution is inan emulation mode. In emulation mode, emulation software is executed bya native processor to emulate the architecture of an emulated processor.

The native processor typically executes emulation software comprisingeither firmware or a native operating system to perform emulation of theemulated processor. The emulation software is responsible for fetchingand executing instructions of the emulated processor architecture. Theemulation software maintains an emulated program counter to keep trackof instruction boundaries. The emulation software may fetch one or moreemulated machine instructions at a time and convert the one or moreemulated machine instructions to a corresponding group of native machineinstructions for execution by the native processor. These convertedinstructions may be cached such that a faster conversion can beaccomplished. Notwithstanding, the emulation software is to maintain thearchitecture rules of the emulated processor architecture so as toassure operating systems and applications written for the emulatedprocessor operate correctly. Furthermore, the emulation software is toprovide resources identified by the emulated processor architectureincluding, but not limited to, control registers, general purposeregisters, floating point registers, dynamic address translationfunction including segment tables and page tables for example, interruptmechanisms, context switch mechanisms, Time of Day (TOD) clocks andarchitected interfaces to I/O subsystems such that an operating systemor an application program designed to run on the emulated processor, canbe run on the native processor having the emulation software.

A specific instruction being emulated is decoded, and a subroutine iscalled to perform the function of the individual instruction. Anemulation software function emulating a function of an emulatedprocessor is implemented, for example, in a “C” subroutine or driver, orsome other method of providing a driver for the specific hardware aswill be within the skill of those in the art after understanding thedescription of the preferred embodiment. Various software and hardwareemulation patents including, but not limited to U.S. Pat. No. 5,551,013,entitled “Multiprocessor for Hardware Emulation”, by Beausoleil et al.;and U.S. Pat. No. 6,009,261, entitled “Preprocessing of Stored TargetRoutines for Emulating Incompatible Instructions on a Target Processor”,by Scalzi et al; and U.S. Pat. No. 5,574,873, entitled “Decoding GuestInstruction to Directly Access Emulation Routines that Emulate the GuestInstructions”, by Davidian et al; and U.S. Pat. No. 6,308,255, entitled“Symmetrical Multiprocessing Bus and Chipset Used for CoprocessorSupport Allowing Non-Native Code to Run in a System”, by Gorishek et al;and U.S. Pat. No. 6,463,582, entitled “Dynamic Optimizing Object CodeTranslator for Architecture Emulation and Dynamic Optimizing Object CodeTranslation Method”, by Lethin et al; and U.S. Pat. No. 5,790,825,entitled “Method for Emulating Guest Instructions on a Host ComputerThrough Dynamic Recompilation of Host Instructions”, by Eric Traut, eachof which is hereby incorporated herein by reference in its entirety; andmany others, illustrate a variety of known ways to achieve emulation ofan instruction format architected for a different machine for a targetmachine available to those skilled in the art.

In FIG. 17, an example of an emulated host computer system 5092 isprovided that emulates a host computer system 5000′ of a hostarchitecture. In the emulated host computer system 5092, the hostprocessor (CPU) 5091 is an emulated host processor (or virtual hostprocessor) and comprises an emulation processor 5093 having a differentnative instruction set architecture than that of the processor 5091 ofthe host computer 5000′. The emulated host computer system 5092 hasmemory 5094 accessible to the emulation processor 5093. In the exampleembodiment, the memory 5094 is partitioned into a host computer memory5096 portion and an emulation routines 5097 portion. The host computermemory 5096 is available to programs of the emulated host computer 5092according to host computer architecture. The emulation processor 5093executes native instructions of an architected instruction set of anarchitecture other than that of the emulated processor 5091, the nativeinstructions obtained from emulation routines memory 5097, and mayaccess a host instruction for execution from a program in host computermemory 5096 by employing one or more instruction(s) obtained in asequence & access/decode routine which may decode the hostinstruction(s) accessed to determine a native instruction executionroutine for emulating the function of the host instruction accessed.Other facilities that are defined for the host computer system 5000′architecture may be emulated by architected facilities routines,including such facilities as general purpose registers, controlregisters, dynamic address translation and I/O subsystem support andprocessor cache, for example. The emulation routines may also takeadvantage of functions available in the emulation processor 5093 (suchas general registers and dynamic translation of virtual addresses) toimprove performance of the emulation routines. Special hardware andoff-load engines may also be provided to assist the processor 5093 inemulating the function of the host computer 5000′.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising”, when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components and/or groups thereof.

The corresponding structures, materials, acts, and equivalents of allmeans or step plus function elements in the claims below, if any, areintended to include any structure, material, or act for performing thefunction in combination with other claimed elements as specificallyclaimed. The description of one or more aspects of the present inventionhas been presented for purposes of illustration and description, but isnot intended to be exhaustive or limited to the invention in the formdisclosed. Many modifications and variations will be apparent to thoseof ordinary skill in the art without departing from the scope and spiritof the invention. The embodiment was chosen and described in order tobest explain the principles of the invention and the practicalapplication, and to enable others of ordinary skill in the art tounderstand the invention for various embodiment with variousmodifications as are suited to the particular use contemplated.

What is claimed is:
 1. A computer program product for facilitatingprocessing in a computing environment, said computer program productcomprising: a non-transitory computer readable storage medium readableby a processing circuit and storing instructions for execution by theprocessing circuit for performing a method comprising: providing by afirst program to a second program a warning track facility installedindication indicating installation of a warning track facility withinthe computing environment, the indication of installation to be obtainedby the second program, and the warning track facility to provide to thesecond program a grace period to perform a first function; obtaining, bythe first program based on the providing, an unsolicited indication thatthe second program has registered for the warning track facility, theregistration comprising an indication to the first program that thesecond program understands a protocol of the warning track facility andintends to participate in the warning track facility; enabling, based onobtaining the indication that the second program has registered, thewarning track facility for the second program; providing by the firstprogram to the second program a warning track notification to notify thesecond program of the grace period in which to initiate the firstfunction; performing by the first program a second function subsequentto the grace period; determining whether the second program voluntarilyexited prior to expiration of the grace period; based on determining thesecond program voluntarily exited prior to expiration of the graceperiod, providing to the second program, a next time the second programexecutes, positive feedback indicating voluntarily exiting prior toexpiration of the grace period; and based on determining the secondprogram is tardy on voluntarily exiting prior to expiration of the graceperiod, providing to the second program, a next time the second programexecutes, an exception feedback indication indicating tardiness involuntarily exiting.
 2. The computer program product of claim 1, whereinthe warning track notification comprises an interruption in which sharedresources assigned to the second program are released subsequent totermination of the grace period.
 3. The computer program product ofclaim 1, wherein the first program is a host program and the secondprogram is a guest program, the guest program having access to sharedresources of the computing environment during a timeslice provided to aguest central processing unit on which the guest program executes. 4.The computer program product of claim 1, wherein the first functioncomprises one of: completing a dispatchable unit executing on aprocessor in which the second program executes; or making thedispatchable unit re-dispatchable on another processor of the computingenvironment.
 5. The computer program product of claim 1, wherein themethod further comprises obtaining an indication by the first program ofcompletion by the second program of the first function during the graceperiod.
 6. The computer program product of claim 5, wherein the methodfurther comprises providing an indication to the second program a nexttime the second program executes that the first function completedduring the grace period.
 7. The computer program product of claim 1,wherein registration is performed via a Diagnose instruction, theDiagnose instruction comprising a register parameter to signal that thesecond program understands a warning track interruption of the warningtrack facility.
 8. The computer program product of claim 1, wherein themethod further comprises: determining, based on a timer interruptioncondition of a first program timer or a warning track interventionrequest, whether a grace period active control indicator is set; basedon the grace period active control indicator not being set, setting thegrace period active control indicator; saving a current value of thefirst program timer as a saved value; setting the first program timer tothe grace period; determining whether the second program is enabled forthe warning track facility; and based on determining the second programis enabled, notifying the second program that the grace period hasbegun.
 9. A computer system for facilitating processing in a computingenvironment, said computer system comprising: a memory; and a processorin communications with the memory, wherein the computer system isconfigured to perform a method, said method comprising: providing by afirst program to a second program a warning track facility installedindication indicating installation of a warning track facility withinthe computing environment, the indication of installation to be receivedby the second program, and the warning track facility to provide to thesecond program a grace period to perform a first function; obtaining, bythe first program based on the providing, an unsolicited indication thatthe second program has registered for the warning track facility, theregistration comprising an indication to the first program that thesecond program understands a protocol of the warning track facility andintends to participate in the warning track facility; enabling, based onobtaining the indication that the second program has registered, thewarning track facility for the second program; providing by the firstprogram to the second program a warning track notification to notify thesecond program of the grace period in which to initiate the firstfunction; performing by the first program a second function subsequentto the grace period, wherein the grace period is distinguishable from atimeslice provided to a processor on which the second program executes,the second program having access to shared resources of the computingenvironment during the timeslice, and wherein the grace period providesa period in addition to the timeslice, wherein any portion of the periodused by the second program to perform the first function is chargedagainst a next timeslice for the second program; determining whether thesecond program voluntarily exited prior to expiration of the graceperiod; based on determining the second program voluntarily exited priorto expiration of the grace period, providing to the second program, anext time the second program executes, positive feedback indicatingvoluntarily exiting prior to expiration of the grace period; and basedon determining the second program is tardy on voluntarily exiting priorto expiration of the grace period, providing to the second program, anext time the second program executes, an exception feedback indicationindicating tardiness in voluntarily exiting.
 10. The computer system ofclaim 9, wherein the warning track notification comprises aninterruption in which shared resources assigned to the second programare released subsequent to termination of the grace period.
 11. Thecomputer system of claim 9, wherein the first function comprises one of:completing a dispatchable unit executing on a processor in which thesecond program executes; or making the dispatchable unit re-dispatchableon another processor of the computing environment.
 12. The computersystem of claim 9, wherein the method further comprises obtaining anindication by the first program of completion by the second program ofthe first function during the grace period.
 13. The computer system ofclaim 9, wherein registration is performed via a Diagnose instruction,the Diagnose instruction comprising a register parameter to signal thatthe second program understands a warning track interruption of thewarning track facility.
 14. The computer system of claim 9, wherein themethod further comprises: determining, based on a timer interruptioncondition of a first program timer or a warning track interventionrequest, whether a grace period active control indicator is set; basedon the grace period active control indicator not being set, setting thegrace period active control indicator; saving a current value of thefirst program timer as a saved value; setting the first program timer tothe grace period; determining whether the second program is enabled forthe warning track facility; and based on determining the second programis enabled, notifying the second program that the grace period hasbegun.
 15. A computer-implemented method of facilitating processing in acomputing environment, said computer-implemented method comprising:providing by a first program to a second program a warning trackfacility installed indication indicating installation of a warning trackfacility within the computing environment, the indication ofinstallation to be received by the second program, and the warning trackfacility to provide to the second program a grace period to perform afirst function; obtaining, by the first program based on the providing,an unsolicited indication that the second program has registered for thewarning track facility, the registration comprising an indication to thefirst program that the second program understands a protocol of thewarning track facility and intends to participate in the warning trackfacility; enabling, based on obtaining the indication that the secondprogram has registered, the warning track facility for the secondprogram; providing by the first program to the second program a warningtrack notification to notify the second program of the grace period inwhich to initiate the first function; performing by the first program asecond function subsequent to the grace period, wherein the grace periodis distinguishable from a timeslice provided to a processor on which thesecond program executes, the second program having access to sharedresources of the computing environment during the timeslice, and whereinthe grace period provides a period in addition to the timeslice, whereinany portion of the period used by the second program to perform thefirst function is charged against a next timeslice for the secondprogram; determining whether the second program voluntarily exited priorto expiration of the grace period; based on determining the secondprogram voluntarily exited prior to expiration of the grace period,providing to the second program, a next time the second programexecutes, positive feedback indicating voluntarily exiting prior toexpiration of the grace period; and based on determining the secondprogram is tardy on voluntarily exiting prior to expiration of the graceperiod, providing to the second program, a next time the second programexecutes, an exception feedback indication indicating tardiness involuntarily exiting.
 16. The computer-implemented method of claim 15,wherein the warning track notification comprises an interruption inwhich shared resources assigned to the second program are releasedsubsequent to termination of the grace period.
 17. Thecomputer-implemented method of claim 15, wherein the first functioncomprises one of: completing a dispatchable unit executing on aprocessor in which the second program executes; or making thedispatchable unit re-dispatchable on another processor of the computingenvironment.
 18. The computer-implemented method of claim 15, furthercomprising obtaining an indication by the first program of completion bythe second program of the first function during the grace period. 19.The computer-implemented method of claim 15, wherein registration isperformed via a Diagnose instruction, the Diagnose instructioncomprising a register parameter to signal that the second programunderstands a warning track interruption of the warning track facility.20. The computer-implemented method of claim 15, further comprising:determining, based on a timer interruption condition of a first programtimer or a warning track intervention request, whether a grace periodactive control indicator is set; based on the grace period activecontrol indicator not being set, setting the grace period active controlindicator; saving a current value of the first program timer as a savedvalue; setting the first program timer to the grace period; determiningwhether the second program is enabled for the warning track facility;and based on determining the second program is enabled, notifying thesecond program that the grace period has begun.